import React, { useRef } from "react";

const useLatest = (value: any): React.MutableRefObject<any> => {
  const ref = useRef<any>(value);
  ref.current = value;

  return ref;
};

export { useLatest };
